<?php

declare(strict_types=1);

namespace App\Controller\Cash\v1;

use App\Controller\AbstractController;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Hyperf\Di\Annotation\Inject;
use App\Middleware\CashMiddleware;
use Hyperf\HttpServer\Annotation\Middleware;
use Service\OrderService\ScreenOrderService;

/**
 * 大屏数据
 * @Controller(prefix="/cash/v1/screen")
 * @Middleware(CashMiddleware::class)
 */
class ScreenController extends AbstractController
{
    /**
     * @Inject
     * @var ScreenOrderService
     */
    protected $screenOrderService;
    
    /**
     * 大屏订单数据
     * @RequestMapping(path="orderlist", methods="post")
     */
    public function orderlist(RequestInterface $request)
    {
        return $this->screenOrderService->screenReportOrderData($request->getParsedBody());
    }

    /**
     * 第二版定制化大屏订单数据
     * @RequestMapping (path="screenOrderList",methods="post")
     * @param RequestInterface $request
     */
    public function screenOrderList(RequestInterface $request)
    {
        return $this->screenOrderService->screenOrderList($request->getParsedBody());
    }
}
